package net.hn.hnms.biz.equipment.company.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import net.hn.hnms.biz.equipment.company.domain.dto.CompanyProductionStatementDto;
import net.hn.hnms.biz.equipment.company.service.CompanyServer;
import net.hn.hnms.biz.equipment.domain.vo.ProductionStatementVo;
import net.hn.hnms.sys.common.core.domain.R;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Api(value = "公司端-生产管控-重大设备", tags = {"公司端-生产管控-重大设备"})
@RestController
@RequestMapping("company/production/equipment")
public class EquipmentCompanyController {
    @Resource
    private CompanyServer companyServer;
    @GetMapping("operationRate")
    @ApiOperation("生产看板-本月开机率台账")
    public R<Map> operationRate(@ApiParam(value = "公司编码") String companyCode,
                                @ApiParam(value = "煤矿编码") String mineCode,
                                @ApiParam(value = "月份：yyyy-MM-dd")@DateTimeFormat(pattern = "yyyy-MM-dd") Date month){
        Map map = companyServer.operationRate(companyCode,mineCode,month);
        return R.ok(map);
    }

    @GetMapping("getProductionStatementBydeviceType")
    @ApiOperation("生产报表-根据生产设备类型获取生产报表")
    public R<List<ProductionStatementVo>> getProductionStatementBydeviceType(CompanyProductionStatementDto companyProductionStatementDto) {
        List<ProductionStatementVo> list=companyServer.getCompanyProductionStatementBydeviceType(companyProductionStatementDto);
        return R.ok(list);
    }
}
